A container-managed software component relies on the container to perform persistent data access on behalf of the object of the component. Here the application component can be an instance of a programmable class (also referred to as class), which can be but is not limited to, a Java bean, an Enterprise Java Bean (EJB), an interface, a module, and other suitable concepts, and container-managed persistence (CMP) bean will be used to illustrate the various embodiments of the invention in the following context. An Enterprise Java Bean (EJB) is a server-side application component that encapsulates the business logic of an application. The instances of an EJB are created and managed at runtime by a container, which runs as part of an application server to provide enterprise applications with a high level of abstraction. A container-managed persistence (CMP) bean, especially an entity bean, relies on the container to perform persistent data access on behalf of the instances of the EJB. The container transfers data between an instance of a CMP bean and the underlying data source (such as a database) as a result of the execution of the methods of the EJB, such as SQL statements. On the contrary, a bean-managed persistence (BMP) bean relies on the own methods of the EJB to perform persistent data access on behalf of the instances of the BMP bean.
The CMP bean corresponds to a table in the underlying database while each instance of the CMP bean often corresponds to an entry in the table. Here, the database can be a relational database, an object-oriented database, a DB2, an Informix Database, an Oracle Database, an SQL Server, a Sybase Database, a Point Base, and an SQL Server2000, and other suitable database. Multiple instances of the same type of CMP bean are often modified and/or updated in a single transaction they are enrolled in. Sometimes, a transaction needs to update thousands of CMP bean instances, and causes thousands of database roundtrips as the result. Such process is not very efficient, and may become a performance bottleneck. Users would either have to suffer the performance consequence or use SQL statements directly to update entries in the database, neither approach is very desirable.